.class public Lcom/brixd/niceapp/community/activity/SelectTagActivity;
.super Lcom/brixd/niceapp/activity/AbsActionBarSwipeBackActivity;
.source "SelectTagActivity.java"


# instance fields
.field private mSelectedCount:I

.field private mTagListView:Lcom/niceapp/lib/tagview/TagListView;

.field private mTags:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Lcom/brixd/niceapp/model/TagModel;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method public constructor <init>()V
    .registers 1

    .prologue
    .line 33
    invoke-direct {p0}, Lcom/brixd/niceapp/activity/AbsActionBarSwipeBackActivity;-><init>()V

    return-void
.end method

.method static synthetic access$000(Lcom/brixd/niceapp/community/activity/SelectTagActivity;)Ljava/util/List;
    .registers 2
    .param p0, "x0"    # Lcom/brixd/niceapp/community/activity/SelectTagActivity;

    .prologue
    .line 33
    iget-object v0, p0, Lcom/brixd/niceapp/community/activity/SelectTagActivity;->mTags:Ljava/util/List;

    return-object v0
.end method

.method static synthetic access$002(Lcom/brixd/niceapp/community/activity/SelectTagActivity;Ljava/util/List;)Ljava/util/List;
    .registers 2
    .param p0, "x0"    # Lcom/brixd/niceapp/community/activity/SelectTagActivity;
    .param p1, "x1"    # Ljava/util/List;

    .prologue
    .line 33
    iput-object p1, p0, Lcom/brixd/niceapp/community/activity/SelectTagActivity;->mTags:Ljava/util/List;

    return-object p1
.end method

.method static synthetic access$100(Lcom/brixd/niceapp/community/activity/SelectTagActivity;Ljava/util/ArrayList;)V
    .registers 2
    .param p0, "x0"    # Lcom/brixd/niceapp/community/activity/SelectTagActivity;
    .param p1, "x1"    # Ljava/util/ArrayList;

    .prologue
    .line 33
    invoke-direct {p0, p1}, Lcom/brixd/niceapp/community/activity/SelectTagActivity;->updateTagStatus(Ljava/util/ArrayList;)V

    return-void
.end method

.method static synthetic access$200(Lcom/brixd/niceapp/community/activity/SelectTagActivity;)Lcom/niceapp/lib/tagview/TagListView;
    .registers 2
    .param p0, "x0"    # Lcom/brixd/niceapp/community/activity/SelectTagActivity;

    .prologue
    .line 33
    iget-object v0, p0, Lcom/brixd/niceapp/community/activity/SelectTagActivity;->mTagListView:Lcom/niceapp/lib/tagview/TagListView;

    return-object v0
.end method

.method static synthetic access$300(Lcom/brixd/niceapp/community/activity/SelectTagActivity;)Landroid/os/Handler;
    .registers 2
    .param p0, "x0"    # Lcom/brixd/niceapp/community/activity/SelectTagActivity;

    .prologue
    .line 33
    iget-object v0, p0, Lcom/brixd/niceapp/community/activity/SelectTagActivity;->mHandler:Landroid/os/Handler;

    return-object v0
.end method

.method static synthetic access$400(Lcom/brixd/niceapp/community/activity/SelectTagActivity;)Ljava/util/ArrayList;
    .registers 2
    .param p0, "x0"    # Lcom/brixd/niceapp/community/activity/SelectTagActivity;

    .prologue
    .line 33
    invoke-direct {p0}, Lcom/brixd/niceapp/community/activity/SelectTagActivity;->getSelectedTags()Ljava/util/ArrayList;

    move-result-object v0

    return-object v0
.end method

.method static synthetic access$500(Lcom/brixd/niceapp/community/activity/SelectTagActivity;)I
    .registers 2
    .param p0, "x0"    # Lcom/brixd/niceapp/community/activity/SelectTagActivity;

    .prologue
    .line 33
    iget v0, p0, Lcom/brixd/niceapp/community/activity/SelectTagActivity;->mSelectedCount:I

    return v0
.end method

.method static synthetic access$508(Lcom/brixd/niceapp/community/activity/SelectTagActivity;)I
    .registers 3
    .param p0, "x0"    # Lcom/brixd/niceapp/community/activity/SelectTagActivity;

    .prologue
    .line 33
    iget v0, p0, Lcom/brixd/niceapp/community/activity/SelectTagActivity;->mSelectedCount:I

    add-int/lit8 v1, v0, 0x1

    iput v1, p0, Lcom/brixd/niceapp/community/activity/SelectTagActivity;->mSelectedCount:I

    return v0
.end method

.method static synthetic access$510(Lcom/brixd/niceapp/community/activity/SelectTagActivity;)I
    .registers 3
    .param p0, "x0"    # Lcom/brixd/niceapp/community/activity/SelectTagActivity;

    .prologue
    .line 33
    iget v0, p0, Lcom/brixd/niceapp/community/activity/SelectTagActivity;->mSelectedCount:I

    add-int/lit8 v1, v0, -0x1

    iput v1, p0, Lcom/brixd/niceapp/community/activity/SelectTagActivity;->mSelectedCount:I

    return v0
.end method

.method private getSelectedTags()Ljava/util/ArrayList;
    .registers 5
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/ArrayList",
            "<",
            "Lcom/niceapp/lib/tagview/Tag;",
            ">;"
        }
    .end annotation

    .prologue
    .line 163
    new-instance v1, Ljava/util/ArrayList;

    invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V

    .line 164
    .local v1, "selectedTags":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lcom/niceapp/lib/tagview/Tag;>;"
    const/4 v0, 0x0

    .local v0, "i":I
    :goto_6
    iget-object v2, p0, Lcom/brixd/niceapp/community/activity/SelectTagActivity;->mTags:Ljava/util/List;

    invoke-interface {v2}, Ljava/util/List;->size()I

    move-result v2

    if-ge v0, v2, :cond_4a

    .line 165
    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "isChecked:"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    iget-object v2, p0, Lcom/brixd/niceapp/community/activity/SelectTagActivity;->mTags:Ljava/util/List;

    invoke-interface {v2, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/brixd/niceapp/model/TagModel;

    invoke-virtual {v2}, Lcom/brixd/niceapp/model/TagModel;->isChecked()Z

    move-result v2

    invoke-virtual {v3, v2}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Lcom/zuiapps/suite/utils/log/LogUtil;->e(Ljava/lang/String;)V

    .line 166
    iget-object v2, p0, Lcom/brixd/niceapp/community/activity/SelectTagActivity;->mTags:Ljava/util/List;

    invoke-interface {v2, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/brixd/niceapp/model/TagModel;

    invoke-virtual {v2}, Lcom/brixd/niceapp/model/TagModel;->isChecked()Z

    move-result v2

    if-eqz v2, :cond_47

    .line 167
    iget-object v2, p0, Lcom/brixd/niceapp/community/activity/SelectTagActivity;->mTags:Ljava/util/List;

    invoke-interface {v2, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 164
    :cond_47
    add-int/lit8 v0, v0, 0x1

    goto :goto_6

    .line 171
    :cond_4a
    return-object v1
.end method

.method private initData()V
    .registers 5

    .prologue
    .line 66
    invoke-static {}, Lcom/brixd/niceapp/util/LocalCacheUtils;->getLocalTagModels()Ljava/util/List;

    move-result-object v1

    iput-object v1, p0, Lcom/brixd/niceapp/community/activity/SelectTagActivity;->mTags:Ljava/util/List;

    .line 67
    iget-object v1, p0, Lcom/brixd/niceapp/community/activity/SelectTagActivity;->mTags:Ljava/util/List;

    invoke-interface {v1}, Ljava/util/List;->size()I

    move-result v1

    if-lez v1, :cond_25

    .line 68
    invoke-virtual {p0}, Lcom/brixd/niceapp/community/activity/SelectTagActivity;->getIntent()Landroid/content/Intent;

    move-result-object v1

    const-string v2, "Tags"

    invoke-virtual {v1, v2}, Landroid/content/Intent;->getSerializableExtra(Ljava/lang/String;)Ljava/io/Serializable;

    move-result-object v1

    check-cast v1, Ljava/util/ArrayList;

    invoke-direct {p0, v1}, Lcom/brixd/niceapp/community/activity/SelectTagActivity;->updateTagStatus(Ljava/util/ArrayList;)V

    .line 69
    iget-object v1, p0, Lcom/brixd/niceapp/community/activity/SelectTagActivity;->mTagListView:Lcom/niceapp/lib/tagview/TagListView;

    iget-object v2, p0, Lcom/brixd/niceapp/community/activity/SelectTagActivity;->mTags:Ljava/util/List;

    const/4 v3, 0x1

    invoke-virtual {v1, v2, v3}, Lcom/niceapp/lib/tagview/TagListView;->setTags(Ljava/util/List;Z)V

    .line 72
    :cond_25
    invoke-static {p0}, Lcom/brixd/niceapp/service/adapter/ReqRestAdapter;->niceAppAdapter(Landroid/content/Context;)Lretrofit/RestAdapter;

    move-result-object v1

    const-class v2, Lcom/brixd/niceapp/service/restful/NiceAppRestfulRequest;

    invoke-virtual {v1, v2}, Lretrofit/RestAdapter;->create(Ljava/lang/Class;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/brixd/niceapp/service/restful/NiceAppRestfulRequest;

    .line 73
    .local v0, "request":Lcom/brixd/niceapp/service/restful/NiceAppRestfulRequest;
    const-string v1, "zuimei.tag.recommend"

    const/4 v2, 0x2

    new-instance v3, Lcom/brixd/niceapp/community/activity/SelectTagActivity$1;

    invoke-direct {v3, p0}, Lcom/brixd/niceapp/community/activity/SelectTagActivity$1;-><init>(Lcom/brixd/niceapp/community/activity/SelectTagActivity;)V

    invoke-interface {v0, v1, v2, v3}, Lcom/brixd/niceapp/service/restful/NiceAppRestfulRequest;->queryTags(Ljava/lang/String;ILretrofit/Callback;)V

    .line 100
    return-void
.end method

.method private initWidgets()V
    .registers 2

    .prologue
    .line 103
    const v0, 0x7f0c00eb

    invoke-virtual {p0, v0}, Lcom/brixd/niceapp/community/activity/SelectTagActivity;->setTopTitle(I)V

    .line 104
    const v0, 0x7f0c005b

    invoke-virtual {p0, v0}, Lcom/brixd/niceapp/community/activity/SelectTagActivity;->setCommitBtnText(I)V

    .line 105
    const v0, 0x7f0c0037

    invoke-virtual {p0, v0}, Lcom/brixd/niceapp/community/activity/SelectTagActivity;->setBackText(I)V

    .line 107
    const v0, 0x7f0a0089

    invoke-virtual {p0, v0}, Lcom/brixd/niceapp/community/activity/SelectTagActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Lcom/niceapp/lib/tagview/TagListView;

    iput-object v0, p0, Lcom/brixd/niceapp/community/activity/SelectTagActivity;->mTagListView:Lcom/niceapp/lib/tagview/TagListView;

    .line 108
    return-void
.end method

.method private initWidgetsActions()V
    .registers 3

    .prologue
    .line 111
    new-instance v0, Lcom/brixd/niceapp/community/activity/SelectTagActivity$2;

    invoke-direct {v0, p0}, Lcom/brixd/niceapp/community/activity/SelectTagActivity$2;-><init>(Lcom/brixd/niceapp/community/activity/SelectTagActivity;)V

    invoke-virtual {p0, v0}, Lcom/brixd/niceapp/community/activity/SelectTagActivity;->setOnBackClickListener(Landroid/view/View$OnClickListener;)V

    .line 119
    new-instance v0, Lcom/brixd/niceapp/community/activity/SelectTagActivity$3;

    invoke-direct {v0, p0}, Lcom/brixd/niceapp/community/activity/SelectTagActivity$3;-><init>(Lcom/brixd/niceapp/community/activity/SelectTagActivity;)V

    invoke-virtual {p0, v0}, Lcom/brixd/niceapp/community/activity/SelectTagActivity;->setOnCommitClickListener(Landroid/view/View$OnClickListener;)V

    .line 130
    iget-object v0, p0, Lcom/brixd/niceapp/community/activity/SelectTagActivity;->mTagListView:Lcom/niceapp/lib/tagview/TagListView;

    new-instance v1, Lcom/brixd/niceapp/community/activity/SelectTagActivity$4;

    invoke-direct {v1, p0}, Lcom/brixd/niceapp/community/activity/SelectTagActivity$4;-><init>(Lcom/brixd/niceapp/community/activity/SelectTagActivity;)V

    invoke-virtual {v0, v1}, Lcom/niceapp/lib/tagview/TagListView;->setOnTagCheckedChangedListener(Lcom/niceapp/lib/tagview/TagListView$OnTagCheckedChangedListener;)V

    .line 148
    return-void
.end method

.method private updateTagStatus(Ljava/util/ArrayList;)V
    .registers 6
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/ArrayList",
            "<",
            "Lcom/niceapp/lib/tagview/Tag;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 151
    .local p1, "selectedTags":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lcom/niceapp/lib/tagview/Tag;>;"
    invoke-virtual {p1}, Ljava/util/ArrayList;->size()I

    move-result v2

    iput v2, p0, Lcom/brixd/niceapp/community/activity/SelectTagActivity;->mSelectedCount:I

    .line 153
    const/4 v0, 0x0

    .local v0, "i":I
    :goto_7
    invoke-virtual {p1}, Ljava/util/ArrayList;->size()I

    move-result v2

    if-ge v0, v2, :cond_49

    .line 154
    const/4 v1, 0x0

    .local v1, "j":I
    :goto_e
    iget-object v2, p0, Lcom/brixd/niceapp/community/activity/SelectTagActivity;->mTags:Ljava/util/List;

    invoke-interface {v2}, Ljava/util/List;->size()I

    move-result v2

    if-ge v1, v2, :cond_46

    .line 155
    invoke-virtual {p1, v0}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/niceapp/lib/tagview/Tag;

    invoke-virtual {v2}, Lcom/niceapp/lib/tagview/Tag;->getId()I

    move-result v3

    iget-object v2, p0, Lcom/brixd/niceapp/community/activity/SelectTagActivity;->mTags:Ljava/util/List;

    invoke-interface {v2, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/brixd/niceapp/model/TagModel;

    invoke-virtual {v2}, Lcom/brixd/niceapp/model/TagModel;->getId()I

    move-result v2

    if-ne v3, v2, :cond_43

    .line 156
    iget-object v2, p0, Lcom/brixd/niceapp/community/activity/SelectTagActivity;->mTags:Ljava/util/List;

    invoke-interface {v2, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/brixd/niceapp/model/TagModel;

    invoke-virtual {p1, v0}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lcom/niceapp/lib/tagview/Tag;

    invoke-virtual {v3}, Lcom/niceapp/lib/tagview/Tag;->isChecked()Z

    move-result v3

    invoke-virtual {v2, v3}, Lcom/brixd/niceapp/model/TagModel;->setChecked(Z)V

    .line 154
    :cond_43
    add-int/lit8 v1, v1, 0x1

    goto :goto_e

    .line 153
    :cond_46
    add-int/lit8 v0, v0, 0x1

    goto :goto_7

    .line 160
    .end local v1    # "j":I
    :cond_49
    return-void
.end method


# virtual methods
.method protected onCreate(Landroid/os/Bundle;)V
    .registers 3
    .param p1, "savedInstanceState"    # Landroid/os/Bundle;

    .prologue
    .line 56
    invoke-super {p0, p1}, Lcom/brixd/niceapp/activity/AbsActionBarSwipeBackActivity;->onCreate(Landroid/os/Bundle;)V

    .line 57
    const v0, 0x7f030073

    invoke-virtual {p0, v0}, Lcom/brixd/niceapp/community/activity/SelectTagActivity;->setContentView(I)V

    .line 59
    invoke-direct {p0}, Lcom/brixd/niceapp/community/activity/SelectTagActivity;->initWidgets()V

    .line 60
    invoke-direct {p0}, Lcom/brixd/niceapp/community/activity/SelectTagActivity;->initWidgetsActions()V

    .line 61
    invoke-direct {p0}, Lcom/brixd/niceapp/community/activity/SelectTagActivity;->initData()V

    .line 62
    return-void
.end method

.method protected onPause()V
    .registers 2

    .prologue
    .line 49
    invoke-super {p0}, Lcom/brixd/niceapp/activity/AbsActionBarSwipeBackActivity;->onPause()V

    .line 50
    const-string v0, "SelectTagActivity"

    invoke-static {v0}, Lcom/umeng/analytics/MobclickAgent;->onPageEnd(Ljava/lang/String;)V

    .line 51
    invoke-static {p0}, Lcom/umeng/analytics/MobclickAgent;->onPause(Landroid/content/Context;)V

    .line 52
    return-void
.end method

.method protected onResume()V
    .registers 2

    .prologue
    .line 42
    invoke-super {p0}, Lcom/brixd/niceapp/activity/AbsActionBarSwipeBackActivity;->onResume()V

    .line 43
    const-string v0, "SelectTagActivity"

    invoke-static {v0}, Lcom/umeng/analytics/MobclickAgent;->onPageStart(Ljava/lang/String;)V

    .line 44
    invoke-static {p0}, Lcom/umeng/analytics/MobclickAgent;->onResume(Landroid/content/Context;)V

    .line 45
    return-void
.end method
